import java.awt.image.BufferedImage;
import java.io.File;
import javax.imageio.ImageIO;

public class img {
    public static void main(String[] args) throws Exception {

        BufferedImage image = ImageIO.read(new File("src/微信截图_20240604084911.png"));
        File f = new File("src/微信截图_20240604084911_out.png");
        int width = image.getWidth();
        int height = image.getHeight();

        for(int i = 0; i < width; i++) {
            for(int j = 0; j < height; j++) {

                int p = image.getRGB(i, j);
                int red = (p >> 16) & 0xff;
                int green = (p >> 8) & 0xff;
                int blue = p & 0xff;


                double x = 1.5;
                double r = red;
                double g = green;
                double b = blue;

                red = (int) Math.pow(r,x);
                green = (int)Math.pow(g,x);
                blue =(int)Math.pow(b,x);


                if (red>255) {
                    red=255;
                }
                if (green>255) {
                    green=255;
                }
                if (blue>255) {
                    blue=255;
                }


                p =  (red << 16) | (green << 8) | blue;
                image.setRGB(i, j, p);
            }
        }

        ImageIO.write(image, "png", f);
    }
}